<extend name="Public/head" />
<block name="style">
<style>
	#container{
        height:calc(100% - 100px);
    }
</style>
</block>
<block name="body">
	<div id="container">
	</div>
</block>
<block name="script">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=owLIsmt9WxgAA8y0ZFIGEWzhEw17w5c5">
    </script>

    <script type="text/javascript">

init();
    function init(){
        var map = new BMap.Map('container'); // 实例化地图 
           
            var point = new BMap.Point(115.92, 28.68);  // 创建点坐标
            map.centerAndZoom(point, 13);    
            map.enableScrollWheelZoom() ; //启用滚轮缩放大小 

           // map.centerAndZoom() ; 
        //定位 
        var geolocationControl = new BMap.GeolocationControl() ; 
            geolocationControl.addEventListener('locationSuccess',function(e){

            }); //定位成功 

            geolocationControl.addEventListener('locationError' , function(e){
                
            }) ; //定位失败 
        //本地电影院搜索
        var myKeys = ["电影","电影院","万达","17.5","影城"];
        var local = new BMap.LocalSearch(map, {
                            renderOptions:{map: map, panel:"r-result"},
                            pageCapacity:5
                        });
            local.searchInBounds(myKeys, map.getBounds());

    }




   //  initialize();
   //  function initialize() {
        
   //      var map = new BMap.Map("container");          // 创建地图实例  
   //    //  console.log(map);
   //      var point = new BMap.Point(115.92, 28.68);  // 创建点坐标  
   //      map.enableScrollWheelZoom();                //启用滚轮放大缩小
   //      map.centerAndZoom(point, 13);                 // 初始化地图，设置中心点坐标和地图级别  
   //        var geolocationControl = new BMap.GeolocationControl();
   //        geolocationControl.addEventListener("locationSuccess", function(e){
   //          console.log(e);
   //          // 定位成功事件
   //          var address = '';
   //          address += e.addressComponent.province;
   //          address += e.addressComponent.city;
   //          address += e.addressComponent.district;
   //          address += e.addressComponent.street;
   //          address += e.addressComponent.streetNumber;
   //          alert("当前定位地址为：" + address);
   //        });
   //        geolocationControl.addEventListener("locationError",function(e){
   //          // 定位失败事件
   //          alert(e.message);
   //        });
   //        map.addControl(geolocationControl);
   //         createDom(map , 'haha')

   //  var myKeys = ["电影","电影院","万达","17.5","影城"];
   //  var local = new BMap.LocalSearch(map, {
   //      renderOptions:{map: map, panel:"r-result"},
   //      pageCapacity:5
   //  });
   //  local.searchInBounds(myKeys, map.getBounds());
  


   // }

    </script>
</block>